package deliciouse.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import deliciouse.dao.NewsDao;
import deliciouse.dao.impl.NewsDaoImpl;

@WebServlet("/newsdelete")
public class NewsManegementDeleteSetvlet extends HttpServlet{
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		NewsDao newsdao = new NewsDaoImpl();
		int id = 0;
		if(request.getParameter("id")!=null && !request.getParameter("id").isEmpty())
			id= Integer.valueOf(request.getParameter("id"));
		newsdao.deletenews(id);
		response.sendRedirect("newslistmanegement");
	}

}
